package com.dog.modules.iot.mqtt.produce.service;

import com.dog.modules.iot.dto.common.RobotBasicParamReqDTO;
import com.dog.modules.iot.mqtt.produce.enums.OutCommandType;
import com.dog.modules.iot.mqtt.produce.RobotsMqttProducer;
import com.dog.modules.iot.mqtt.produce.bound.OutboundCommand;
import com.dog.modules.iot.dto.common.OutRobotBasicParamData;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 */
@Service
@Slf4j
public class MqttDeviceService {

    @Autowired
    private RobotsMqttProducer robotsMqttProducer;

    public void reqBasicParam(RobotBasicParamReqDTO req) {
        OutRobotBasicParamData data = new OutRobotBasicParamData();
        data.setRequestId(req.getRequestId());
        OutboundCommand command = new OutboundCommand(OutCommandType.BASIC_PARAM_REQ.getCommand(), data);
        robotsMqttProducer.sendMqttMessageWithSecret(req.getUuid(), command);
    }


}
